#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
map<int, int> mp;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n, m; cin >> n >> m;
    for (int i = 1; i <= n * m; i++) {
        int x; cin >> x;
        mp[x]++;
    }
    for (const auto& [x, y] : mp) {
        if (2 * y > n * m) cout << x << '\n';
    }
    return 0;
}